package com.acoffee.springcloud.consumer.user.feign;

import com.acoffee.springcloud.common.entity.ResponseEntity;
import com.acoffee.springcloud.common.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author acoffee
 * @create 2022-01-21 10:13
 */
//@FeignClient("alibaba-provider-user")
@RequestMapping("/user")
public interface UserFeignClient {

    @RequestMapping("/findById/{id}")
    public ResponseEntity<User> findById(@PathVariable(value = "id") int id);

    @RequestMapping("/findAll")
    public ResponseEntity<List<User>> findAll();

    @PostMapping("/addUser")
    public ResponseEntity<Boolean> addUser(@RequestBody User user);

    @PutMapping("/updateUser")
    public ResponseEntity<Boolean> updateUser(@RequestBody User user);

    @DeleteMapping("/deleteUser/{id}")
    public ResponseEntity<Boolean> deleteUser(@PathVariable(value = "id") int id);

    @GetMapping("/timeout")
    public ResponseEntity<String> timeout();

    @GetMapping("/ok")
    public ResponseEntity<String> ok();
}
